import os
import unittest
from cases.Base_Case import BASECASE
from config.config import DATA_PATH
from page.index import IndexPage
from page.手术管理.手术申请.shoushushenqing__page import shoushushenqing
from tools.sjqd_way import read_data_from_excel
class TestShoushushenqing(BASECASE):
    @classmethod
    def setUpClass(cls):
        ap = IndexPage()
        ap.jrym_no1('手术申请')
    @classmethod
    def tearDownClass(cls):
        ap = IndexPage()
        ap.close_all_xxk()
        print("{}执行完毕-------------------------------------------------".format(cls))
    def test_shoushushenqing(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        bp = shoushushenqing()
        bp.input_name(name)
        bp.click_cx_btn()#点击查询按钮
        bp.click_sj1()#点击数据1
        bp.choose_ssap()#点击手术安排
        bp.click_sj1()  # 点击数据1
        bp.click_bj_btn()#点击编辑
        bp.click_ssjl()#点击手术记录
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "手术")
        zdys,mzys,sj1,sj2,sj3 = self.data[0]
        bp.fill_ssjl(zdys,mzys)
        bp.click_sssf()#点击手术收费
        bp.add_sssfxm(3)
        bp.input_sj1(sj1)
        bp.input_sj2(sj2)
        bp.input_sj3(sj3)
        bp.click_ssjl_tjfy()#点击提交费用
        bp.click_ssjl()  # 点击手术记录
        bp.click_ssjl_shbg()#点击审核报告
        bp.close_window()#关闭窗口
if __name__ == '__main__':
    unittest.main()
